organize code a little