make things fit better
add some cleanup and reusability