refractored some code, deleted some useless methods