refactors all methods