moving the cube css logic to a service to clean up directives a bit