implement code clean up