optimization/refactoring/fixes