moved everything to nice layers ... much cleaner code