Removed redundant code, cleaned up components