added controller concept to components and moved out global object assignments