cleaner
reorder code to improve clarity