code refactoring, fixed spacing issues