Code refactored and using statements cleaned up