Refined style of methods and cleaned up code