cosmetic fixes

1. use dirname() instead of `fancy` logic
2. remove dummy condition statement