removed error logging
optimized code by removing unnecessary statements, moved environment check to always pass through non-rails sitess