code clean up/reworking