Repaired file decider bug from original implementation, minor
refactoring