trying to cleanup my code