Cleaned up code, removed bad references, put components in containers