organize code a bit