Code refactoring regarding DB attribute handle