Code clean-up, better organization