cleaning up functionality a bit