cleanup and few more helper methods