added some changes/fixes from production and made it more "angular"