Started modularizing filter script; adjusted code for details/pagination