refactored/removed useless code