formatted code and cleanup
changed existing tests for new layout