refactoring
moved stuff around