General refactoring; removed redundant usings and formatted code.