refactor code for future stuff