Spring layout works, but needs improvements. Relocated some functions and classes.