clean up a little the code