code cleanup, make more reusable