refactor and stuff ;)